/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-10-19
 * Time: 13:36
 */
//public class TreeNode {
//      char val;
//      TreeNode left;
//      TreeNode right;
//
//    public TreeNode(char val) {
//        this.val = val;
//
//    }
//    static int i=0;
//    public static TreeNode creat(String s){
//        TreeNode t=new TreeNode(s.charAt(i++));
//        if(t.val=='#') return null;
//        t.left=creat(s);
//        t.right=creat(s);
//        return t;
//    }
//    public static void inOrder(TreeNode root){
//        if(root==null) return;
//        inOrder(root.left);
//        System.out.print(root.val+" ");
//        inOrder(root.right);
//    }
//
//    public static void main(String[] args) {
//       TreeNode t= creat("abc##de#g##f###");
//        inOrder(t);
//    }
////    class Solution {
////
////        public static boolean isvalf(TreeNode p, TreeNode q){
////            //判断数据是否相同
////            //子问题
////            if(p==null) return true;
////            if(p.val!=q.val) return false;
////            return isval(p.left,q.right)&&isval(p.right,q.left);
////        }
////        public static boolean isSymmetric(TreeNode root) {
////            if(root==null) return true;
////            return iscon(root.left,root.right)&&isvalf(root.left,root.right);
////
////        }
////        public static boolean iscon(TreeNode p, TreeNode q){
////            //判断结构是否相同
////            //子问题
////            if(p==null&&q==null) return true;
////            if(p!=null&&q==null) return false;
////            if(p==null&&q!=null) return false;
////            if(p!=null&&q!=null){
////                return iscon(p.right,q.right)&&iscon(p.left,q.left);
////            }
////            return false;
////        }
////        public static boolean isval(TreeNode p, TreeNode q){
////            //判断数据是否相同
////            //子问题
////            if(p==null) return true;
////            if(p.val!=q.val) return false;
////            return isval(p.left,q.left)&&isval(p.right,q.right);
////        }
////        public static boolean isSameTree(TreeNode p, TreeNode q) {
////            return iscon(p,q)&&isval(p,q);
////        }
////        public boolean isSubtree(TreeNode root, TreeNode subRoot) {
////            if(root==null) return false;
////            return isSameTree(root.left,subRoot)||isSameTree(root.right,subRoot);
////        }
////
////        public TreeNode invertTree(TreeNode root) {
////            //遍历法
////            if(root==null) return null;
////            TreeNode t=root.left;
////            root.left=root.right;
////            root.right=t;
////
////            invertTree(root.left);
////            invertTree(root.right);
////            return root;
////        }
////    }
////
////    public static int hight(TreeNode root){
////        if(root==null) return 0;
////        return Math.max(hight(root.left),hight(root.right))+1;
////    }
////
////    public boolean isBalanced(TreeNode root) {
////        if(root==null) return true;
////        if(Math.abs(hight(root.left)-hight(root.right))>1) return false;
////        return isBalanced(root.left)&&isBalanced(root.right);
////    }
////    public static void main1(String[] args) {
////        TreeNode p=new TreeNode(1);
////        TreeNode a=new TreeNode(2);
////        TreeNode b=new TreeNode(2);
////        TreeNode c=new TreeNode(3);
////        TreeNode d=new TreeNode(3);
////        p.left=a;
////        p.right=b;
////        a.left=c;
////        b.right=d;
////        boolean sameTree = Solution.isSymmetric(p);
////        System.out.println(sameTree);
////    }
//}
